<template>
  <div id="app">
    <van-button @click="delToken">删除token</van-button>
    <van-button @click="getToken">获取token</van-button>
    <router-view/>
  </div>
</template>
<script>
// import request from '@/utils/request'
import { delItem, getItem, setItem } from '@/utils/storage'
export default {
  created () {
    // 注册接口
    // await axios('http://abcd/xxx')
    // const res = await request.post('/user/register', {
    //   username: 'laohan',
    //   password: '123456'
    // })
    // 登录接口
    // const res = await request.post('/user/login', {
    //   username: 'laohan',
    //   password: '123456'
    // })
    // console.log(res)
    // 测试token
    setItem('abcd')
  },
  methods: {
    delToken () {
      delItem()
    },
    getToken () {
      console.log(getItem())
    }
  }
}
</script>
<style lang="less">

</style>
